//
//  Pics.swift
//  APPCore
//
//  Created by raymond Peng on 2018/8/7.
//  Copyright © 2018 TanBaYe. All rights reserved.
//

import Foundation
import Domain

struct GoodsPics: Decodable {
    let position: Int?   // 如果 position 是 1 表明是显示在外部的展示图
    let picUrl: String?
    let picId: String?
    let sort: Int?
}

extension GoodsPics: IProductPicEntity {
    var picPosition: Int {
        return position ?? -1
    }

    var url: URL? {
        return URL(string: picUrl ?? "")
    }
}
